﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="AddProduct.ascx.cs" Inherits="BusinessSite.AddProduct" %>

<script language="javascript">
function getElement(form, element)
{
 // document.forms[FormName].elements[ElementName].value = Value;
    if(document.all||document.getElementById)
	{
		el = document.all ? document.all[element] : document.getElementById ? document.getElementById(element) : ""
		if(el) {return el;} else { el = document.forms[form].elements[element]; return el; }
	}
}
function submitRequestProduct()
{
    var el = getElement("aspnetForm","ctl00_PageContent_ctl00_ddlProducts");

    if(el)
    {
        var productId = el.options[el.selectedIndex].value;
        document.location.href = "Default.aspx?ipage=addproduct&id="+productId;
    }
}

</script>

<div>
    <form id="formAddProduct" action="../Default.aspx?ipage=addproduct" runat="server">
        <table>
            <tr>
                <td>
                </td>
                <td>
                    <asp:DropDownList ID="ddlProducts" AutoPostBack="false" runat="server" Width="154px" EnableTheming="true">
                      <asp:ListItem Selected="True" Value="" Text=""/>
                    </asp:DropDownList></td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                </td>
            </tr>
            <tr>
                <td runat="server">
                    ProductID :</td>
                <td runat="server" style="width: 158px">
                    <asp:TextBox ID="txtProductId" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td runat="server">
                    ProductName :</td>
                <td runat="server" style="width: 158px">
                    <asp:TextBox ID="txtProductName" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td runat="server">
                    Quantity Per Unit :</td>
                <td runat="server" style="width: 158px">
                    <asp:TextBox ID="txtQuantityPerUnit" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td runat="server">
                    ReorderLevel :</td>
                <td runat="server" style="width: 158px">
                    <asp:TextBox ID="txtReorderLevel" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td runat="server">
                    Unit price :</td>
                <td runat="server" style="width: 158px">
                    <asp:TextBox ID="txtUnitPrice" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td runat="server">
                    Units in stock :</td>
                <td runat="server" style="width: 158px">
                    <asp:TextBox ID="txtUnitsInStock" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td runat="server">
                    Units on order :</td>
                <td runat="server" style="width: 158px">
                    <asp:TextBox ID="txtUnitsOnOrder" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td runat="server">
                </td>
                <td runat="server" style="width: 158px">
                </td>
            </tr>
            <tr>
                <td runat="server">
                </td>
                <td horizontalalign="Right" runat="server" style="width: 158px">
                    <asp:Button ID="btnClearForm" runat="server" Text="Clear" />
                    <asp:Button ID="btnSaveForm" runat="server" Text="Save" />
                </td>
            </tr>
            <tr>
                <td>
                </td>
                <td>
                    <asp:HiddenField ID="id" runat="server" />
                </td>
            </tr>
        </table>
    </form>
</div>
